public class Main {
    public static void main(String[] args) {
        // 创建具体的工厂实例
        CarFactory sedanFactory = new SedanCarFactory();
        CarFactory suvFactory = new SUVCarFactory();
        CarFactory truckFactory = new TruckCarFactory();

        // 使用具体的工厂创建对应的车实例
        Car sedan = sedanFactory.createCar();
        Car suv = suvFactory.createCar();
        Car truck = truckFactory.createCar();

        // 调用车的公共方法和特有方法
        sedan.commonMethod();
        sedan.specificMethod();

        suv.commonMethod();
        suv.specificMethod();

        truck.commonMethod();
        truck.specificMethod();
    }
}